package com.sit.controller;

import com.sit.entity.CompetitionA;
import com.sit.entity.CompetitionT;
import com.sit.service.CompetitionAService;
import com.sit.service.CompetitionTService;
import com.sit.vo.DataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CompetitionTController {

    @Autowired
    private CompetitionTService competitionTService;

    @ResponseBody
    @RequestMapping("/complistT")
    public DataVO complist(){

        return competitionTService.findData();
    }

    @ResponseBody
    @RequestMapping("/addCompT")
    public boolean addComp(CompetitionT competitionT){
        return competitionTService.addComp(competitionT);
    }

    @ResponseBody
    @RequestMapping("/deleteCompT")
    public boolean deleteComp(@RequestParam("cnoA")String cnoA){
       return competitionTService.deleteComp(cnoA);
    }

    @ResponseBody
    @RequestMapping("/updateCompT")
    public boolean updateComp(CompetitionT competitionT){
        return competitionTService.updateComp(competitionT);
    }

    @ResponseBody
    @RequestMapping("/searchCompT")
    public DataVO searchComp(@RequestParam("cnA")String cnA){

        return competitionTService.searchComp(cnA);
    }
}
